/*************************************************************************
	> File Name: P1466.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-04-02 17:25:39
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

long long dp[1000];

int main() {
    int n;
    cin >> n;
    int target = (1 + n) * n / 2;
    if (target % 2) {
        cout << 0 << endl;
        return 0;
    }
    target >>= 1;
    dp[0] = 1;
    for (int i = 1; i <= n; i++) {
        for (int j = target; j >= i; j--) {
            dp[j] += dp[j - i];
        }
    }
    cout << dp[target] / 2 << endl;
    return 0;
}
